<html>

<head>
    <meta charset="UTF-8">
    <title>js数据类型</title>
</head>

<body>
    <ol>
        <li>风
            <!-- <a>清</a> --></li>
        <li>花</li>
        <li>雪</li>
        <li>月</li>
        
    </ol>
    <script>
    'use strict'

    let a = false;
    a = 5;

    let sites = ['sina', 'baidu', 'qq'];

    // console.log(typeof a);
    // console.log(typeof sites);
    // console.log(sites[0]);

    let c = '500 years';
    // console.log(Number(c));
    // console.log(Boolean(c));

    // console.log(window);
    // console.log(window.location);
    // // window.location = 'http://www.baidu.com';
    // // console.log(window.innerHeigh)；
    // // window.alert();
    // console.log(window.navigator);

    var oLi = document.getElementsByTagName('li');
    for (var i in oLi) { console.log(i + '=' + oLi[i]); }
    console.log(oLi);
    console.log(oLi.length);
    console.log(oLi[0].childNodes[0].nodeValue);
    console.log(oLi[0].childNodes[0].nodeName);
    console.log(oLi[0].nodeName);
    console.log(oLi[0].nodeType);
    console.log(oLi[0].childNodes[0].nodeType);
    var oP = document.createElement("p");
    var oText = document.createTextNode("这是一个使用DOM生成的段落");
    oP.appendChild(oText);
    document.body.appendChild(oP);
    </script>
</body>

</html>
